package ma.moliere.transverse.utils;

import ma.moliere.persistance.oe.Eleve;
import ma.moliere.transverse.vo.EleveAffiche;

public final class EleveUtils {
	public EleveUtils() {
	}

	/** Permet de copie un eleve en eleve utilisé dans l'ihm. la copie est complète. */
	public static EleveAffiche copieOeVersVo(final Eleve source) {
		if (source == null) {
			return null;
		}
		EleveAffiche destination = new EleveAffiche();
		// attribut de base d'un élève
		destination.setId(source.getId());
		destination.setMatricule(source.getMatricule());
		destination.setNom(source.getNom());
		destination.setNomarabe(source.getNomar());
		destination.setPrenom(source.getPrenom());
		destination.setPrenomarabe(source.getPrenomar());
		destination.setAdresse(source.getAdresse());
		destination.setVille(source.getVille());
		destination.setQuartier(source.getQuartier());
		destination.setAdressearabe(source.getAdressear());
		destination.setDatenaissance(source.getDatenaissance());
		destination.setLieunaissance(source.getLieunaissance());
		destination.setNationalite(source.getNationalite());
		destination.setNumexam(source.getNumexam());
		destination.setPhoto(source.getPhoto());
		destination.setTuteur(source.getTuteur());
		destination.setMaladie(source.getMaladie());
		destination.setCinmere(source.getCinmere());
		destination.setCinpere(source.getCinpere());
		destination.setNommere(source.getNommere());
		destination.setPrenommere(source.getNommere());
		destination.setEmploimere(source.getEmploimere());
		destination.setVilleemploimere(source.getVilleempmere());
		destination.setTelhomemere(source.getTelhomemere());
		destination.setTelpersomere(source.getTelpersomere());
		destination.setNompere(source.getNompere());
		destination.setPrenompere(source.getNompere());
		destination.setEmploipere(source.getEmploipere());
		destination.setVilleemploipere(source.getVilleempipere());
		destination.setTelhomepere(source.getTelhomepere());
		destination.setTelpersopere(source.getTelpersopere());
		destination.setRemarques(source.getRemarques());
		destination.setFlag(false);
		return destination;
	}

	public static Eleve copieVoVersOe(final EleveAffiche source) {
		if (null == source) {
			return null;
		}
		Eleve destination = new Eleve();
		// attribut de base d'un élève
		destination.setId(source.getId());
		destination.setMatricule(source.getMatricule());
		destination.setNom(source.getNom());
		destination.setNomar(source.getNomarabe());
		destination.setPrenom(source.getPrenom());
		destination.setPrenomar(source.getPrenomarabe());
		destination.setAdresse(source.getAdresse());
		destination.setVille(source.getVille());
		destination.setQuartier(source.getQuartier());
		destination.setAdressear(source.getAdressearabe());
		destination.setDatenaissance(source.getDatenaissance());
		destination.setLieunaissance(source.getLieunaissance());
		destination.setNationalite(source.getNationalite());
		destination.setNumexam(source.getNumexam());
		destination.setPhoto(source.getPhoto());
		destination.setTuteur(source.getTuteur());
		destination.setMaladie(source.getMaladie());
		destination.setCinmere(source.getCinmere());
		destination.setCinpere(source.getCinpere());
		destination.setNommere(source.getNommere());
		destination.setPrenomere(source.getNommere());
		destination.setEmploimere(source.getEmploimere());
		destination.setVilleempmere(source.getVilleemploimere());
		destination.setTelhomemere(source.getTelhomemere());
		destination.setTelpersomere(source.getTelpersomere());
		destination.setNompere(source.getNompere());
		destination.setPrenompere(source.getNompere());
		destination.setEmploipere(source.getEmploipere());
		destination.setVilleempipere(source.getVilleemploipere());
		destination.setTelhomepere(source.getTelhomepere());
		destination.setTelpersopere(source.getTelpersopere());
		destination.setRemarques(source.getRemarques());

		return destination;
	}
}
